/*! \file
 * \brief Enter a brief description here.
 *
 * Enter a detailed description here. (optional)
 * \author Author (Ivo Wingelaar)
 * \date Date (2011)
 * \version Version (0.0.1)
 * \copyright Copyright (GNU LGPL v3)
 */

#ifndef __LYNX_VIDEO_IMAGE_HPP_INCLUDED__
#define __LYNX_VIDEO_IMAGE_HPP_INCLUDED__

#include "LynxColor.hpp"

namespace Lynx
{

class Image : public virtual Myth::ReferenceCounter
{
public:
    virtual void* get_pointer(void) = 0;

    virtual Myth::Math::Vector2u get_dimension(void) const = 0;

    virtual uint32_t get_bits_per_pixel(void) const = 0;

    virtual uint32_t get_bytes_per_pixel(void) const = 0;

    virtual uint32_t get_image_data_size_in_bytes(void) const = 0;

    virtual uint32_t get_image_data_size_in_pixels(void) const = 0;

    virtual Color get_pixel(uint32_t x, uint32_t y) const = 0;

    virtual void set_pixel(uint32_t x, uint32_t y, Color color, bool blend = false) = 0;

    virtual E_COLOR_FORMAT get_color_format(void) const = 0;

    virtual uint32_t get_red_mask(void) const = 0;

    virtual uint32_t get_green_mask(void) const = 0;

    virtual uint32_t get_blue_mask(void) const = 0;

    virtual uint32_t get_alpha_mask(void) const = 0;

    virtual uint32_t get_pitch(void) const = 0;

    virtual void copy_to_scaling(void* target, uint32_t width, uint32_t height, E_COLOR_FORMAT format = ECF_A8R8G8B8, uint32_t pitch = 0) = 0;

    virtual void copy_to_scaling(Image* target) = 0;

    virtual void copy_to(Image* target, const Myth::Math::Vector2i& pos = Myth::Math::Vector2i(0,0)) = 0;

    virtual void copy_to(Image* target, const Myth::Math::Vector2i& pos, const Myth::Math::Rectanglei& sourceRect, const Myth::Math::Rectanglei* clipRect = 0) = 0;

    virtual void copy_to_with_alpha(Image* target, const Myth::Math::Vector2i& pos, const Myth::Math::Rectanglei& sourceRect, Color color, const Myth::Math::Rectanglei* clipRect = 0) = 0;

    virtual void copy_to_scaling_box_filter(Image* target, int32_t bias = 0, bool blend = false) = 0;

    virtual void fill(Color color) = 0;
};

class AnimatedImage : public virtual Myth::ReferenceCounter
{
public:
    virtual uint32_t get_frame_count(void) const = 0;

    virtual Image* get_frame(uint32_t frame) const = 0;
};

} // namespace Lynx

#endif // __LYNX_VIDEO_IMAGE_HPP_INCLUDED__

